<% content_for :sidebar do %>
  <h1>Listing Repairs</h1>
<% end %>

<table id="repairs" class="datatable table table-striped table-bordered" >
  <thead>
    <tr>
      <th>Item</th>
      <th>Item Name</th>
      <th>User</th>
      <th>Repairer</th>
      <th>Category</th>
      <th>Service date</th>
      <th>Status</th>
      <th>Description</th>
      <th>Condition</th>
      <th>Comments</th>
      <th></th>
    </tr>
  </thead>
  <tbody>
    <% @repairs.each do |repair| %>
      <tr>
        <td><%= repair.item_id %></td>
        <td><%= repair.item.name %></td>
        <td><%= repair.user_id %></td>
        <td><%= repair.person.fullname unless repair.person.blank? %></td>
        <td><%= repair.category %></td>
        <td><%= repair.service_date %></td>
        <td><%= repair.status %></td>
        <td><%= repair.description %></td>
        <td><%= repair.condition %></td>
        <td><%= repair.comments %></td>
        <td><%= table_button_link 'Edit', edit_repair_path(repair) %></td>
      </tr>
    <% end %>
  </tbody>
</table>
